[3.9] gh-121285: Remove backtracking when parsing tarfile headers (GH-121286) (#123641)
authorSeth Michael Larson <seth@python.org>
Wed, 4 Sep 2024 15:46:01 +0000 (10:46 -0500)
committerAndrej Shadura <andrewsh@debian.org>
Tue, 20 Jan 2026 10:45:10 +0000 (11:45 +0100)
commit72d61f700372bfeac7a482e653084a3256d135a8
treead0e2a6851e6698af651601ac5b758e0a4ad2af1
parentac84427cd685fa9f5d650fd446bd2b5dc1765480
[3.9] gh-121285: Remove backtracking when parsing tarfile headers (GH-121286) (#123641)

* Remove backtracking when parsing tarfile headers
* Rewrite PAX header parsing to be stricter
* Optimize parsing of GNU extended sparse headers v0.0

(cherry picked from commit 34ddb64d088dd7ccc321f6103d23153256caa5d4)

Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Gbp-Pq: Name 0022-3.9-gh-121285-Remove-backtracking-when-parsing-tarfi.patch
Lib/tarfile.py
Lib/test/test_tarfile.py